﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminSite.Master" AutoEventWireup="true" CodeBehind="ProfitReport.aspx.cs" Inherits="Agents.Admin.ProfitReport" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        דו"חות רווח
    </h1>           
    <hr />         

    <asp:RadioButton ID="radYear" runat="server" CssClass="combobox" Checked="true" 
                    Text="שנתי" GroupName="time" 
                    OnCheckedChanged="rad_CheckedChanged" AutoPostBack="true" />
    <asp:RadioButton ID="radMonth" runat="server" CssClass="combobox" Checked="false" 
                    Text="חודשי" GroupName="time" 
                    OnCheckedChanged="rad_CheckedChanged" AutoPostBack="true" />
    <asp:RadioButton ID="radRange" runat="server" CssClass="combobox" Checked="false" 
                    Text="בחר טווח תאריכים" GroupName="time" 
                    OnCheckedChanged="rad_CheckedChanged" AutoPostBack="true" />

    <br />

    <asp:Panel ID="panelSelectYear" runat="server">
        <asp:DropDownList ID="cmbYears" runat="server" />  
        <asp:Button ID="btnBuildGraph1" runat="server" Text="בצע" 
                    CssClass="button" OnClick="btnBuildGraph_Click" />       
    </asp:Panel>

     <asp:Panel ID="panelSelectMonth" runat="server" Visible="false">
        <asp:DropDownList ID="cmbMonths" runat="server" />     
        <asp:Button ID="btnBuildGraph2" runat="server" Text="בצע" 
                    CssClass="button" OnClick="btnBuildGraph_Click" />   
    </asp:Panel>
    
    <asp:Panel ID="panelSelectRange" runat="server" Visible="false">
        
        תאריך התחלה: <asp:TextBox ID="txtStartDate" runat="server" TextMode="Date" />
        תאריך סיום: <asp:TextBox ID="txtEndDate" runat="server" TextMode="Date" />
        <asp:Button ID="btnBuildGraph3" runat="server" Text="בצע" 
                            CssClass="button" OnClick="btnBuildGraph_Click" />
        <br />
        <asp:RequiredFieldValidator ID="rqStartDate" runat="server" 
            ControlToValidate="txtStartDate" ErrorMessage="יש להזין תאריך התחלה" />
        <asp:RequiredFieldValidator ID="rqEndDate" runat="server" 
            ControlToValidate="txtEndDate" ErrorMessage="יש להזין תאריך סיום" />
    </asp:Panel>
    
    <br />           
    <asp:Chart ID="profitChart" runat="server">
        <Legends>
            <asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="False" Name="Default" LegendStyle="Row" />
        </Legends>
        <Series>
            <asp:Series Name="dataSeries" ChartType="Pie">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="chartArea" Area3DStyle-Enable3D="true">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    מאזן כולל: <asp:Label ID="lblBalance" runat="server" />
    <hr />

    <div class="alignCenter">
        <asp:Button ID="backBtn" Text="חזור" runat="server" onclick="backBtn_Click" 
            CausesValidation="False" CssClass="button"/>
    </div>
</asp:Content>